import { defineStore } from 'pinia';
import type { MenuItem } from "@/utils/router-menu";


export const useUser = defineStore('user', {

  state: () => ({
    name: '' as string,
    roles: [] as string[],
    permissions: [] as string[],
    menu: [] as MenuItem[],
  }),
  actions: {
    setName(name: string){
      this.name = name
    },
    setRoles(roles: string[]){
      this.roles = roles
    },
    setPermissions(permissions: string[]){
      this.permissions = permissions
    },
    setMenu(menu: MenuItem[]){
      this.menu = menu
    }
  },
})
